package efu.nf.like.web.controller;

import efu.nf.like.common.base.BaseController;
import efu.nf.like.common.result.ResultVo;
import efu.nf.like.model.dto.LikeDTO;
import efu.nf.like.service.LikeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lwj
 * @create 2025-10-12-23:59
 */
@RestController
@RequestMapping("/api/like")
@RequiredArgsConstructor
public class LikeController extends BaseController {
    private final LikeService likeService;

    @PostMapping
    public ResultVo<LikeDTO> like(@RequestParam Integer postId, @RequestParam Integer userId) {
        LikeDTO like = likeService.like(postId, userId);

        return success(like);
    }
}
